<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div
      id="content"
      style="
        height: 150px;
        line-height: 150px;
        text-align: center;
        color: #fff;
        background-color: #ccc;
        font-size: 80px;
      "
    ></div>

    <script>
      let num = 1;
      let content = document.getElementById("content");
      console.log(content);

      function count() {
        content.innerHTML = num++;
      }

      function throttle(func, wait) {
        let previous = 0;
        return function () {
          let now = Date.now();
          let context = this;
          let args = arguments;
          if (now - previous > wait) {
            func.apply(context, args);
            previous = now;
          }
        };
      }

      content.onmousemove = throttle(count,1000);
    </script>
  </body>
</html>
